#ifndef STRING_ARRAY_H 
#define STRING_ARRAY_H

#include <iostream>

using namespace std;

class myStr
{
private:
    char* data;
    int length;

    int* next;
    int* nextVal;

public:
    myStr(const char*);
    ~myStr();
    //其他可以考虑的构造函数
    //myStr(const int&);
    //myStr(const myStr&);
   
    void print();
    void kmp_next() ;
    void kmp_nextVal() ;
    void printNext();
    void printNextVal();

    
    friend bool replaceStr(myStr&, const int&, const myStr&, const myStr&);
    friend int kmpMatch(const myStr&, const myStr&);
    friend int simpleMatch(const myStr&, const myStr&);

};

struct matrixNode
{
    int row;
    int col;
    int value;
};

class myMatrix
{
private:
    matrixNode* nodeList;
    int rowNum;
    int colNum;
    int nodeNum;

public:
    myMatrix(const int&, const int&, const int&, const int*);
    myMatrix(){
    rowNum =0;
    colNum = 0;
    nodeNum = 0;
    nodeList = nullptr;//我的电脑在类外实现会报错，所以放里面
};
    
    ~myMatrix();
    
    void printMatrix();
    void FastTransposeSMatrix(myMatrix&);
};



#endif


